<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico"> <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <!-- jqgrid-->
    <link href="__STATIC__/layout/css/plugins/jqgrid/ui.jqgrid.css?0820" rel="stylesheet">
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link rel="stylesheet" href="__STATIC__/layout/css/zTreeStyle.css" type="text/css">
    <style>
        .hide_table{display: none;}
    </style>
</head>

<body style="color:#333;padding:3px;">
    <!-- 标题 -->
         <div class="page-heade">
       <h2 class="title_color text-center">经销商销售目标详细</h2>
    </div>
    <!-- 标题 -->
    <div class="form-horizontal">
      <table class="row-margin-top tab-content table-bordered table text-center" border="1">
           <tr>
            <td>主题：</td>
            <td class="text-left" colspan="9" rowspan="" headers="">{$apply.title}{if condition='$apply.tag eq 2'}<span style="color:red">(此销售预算申请正在异动,申请编号是<a href="{:url('detail')}?tid={$apply.nextid}">{$apply.nextno}</a>)</span>{/if}</td>
          </tr>
          <tr>
            <td>编号：</td>
            <td>{$apply.no}</td>
            {if condition="$apply.tag neq 1"}
               <td>原申请单编号：</td>
                <td>
                {if condition="$apply.yuanno eq ''"}
                无
                {else/}
                <a href="{:url('detail')}?tid={$apply.yuanid}">{$apply.yuanno}</a>
                {/if}
                </td>
            {else/}
                <td>异动后申请编号</td>
                 <td>
                {if condition="$apply.nextno eq ''"}
                无
                {else/}
               <a href="{:url('detail')}?tid={$apply.nextid}"> {$apply.nextno}</a>
                {/if}
                </td>
            {/if}
           
            <td>状态：</td>
            <td>区域领导审批</td>
            <td>申请人：</td>
            <td><a href="javascript:;" class="color_text" title="">{$apply.cname}</a></td>
            <td>申请人部门：</td>
            <td>{$apply.de_name}</td>
          </tr>
           <tr>
            <td>备注：</td>
            <td class="text-left" colspan="9" rowspan="" headers="">{$apply.remark}</td>
          </tr>
      </table>
      <div class="container-fluid">
        <a href="javascript:;" class="btn btn-outline btn-primary cbtn" onclick="fanka(0)">查看详情</a>
         <a href="javascript:;" class="btn btn-outline btn-primary cbtn" onclick="fanka(1)">明细汇总</a>
         {if $apply.state2==2}
          <a href="javascript:;" class="btn btn-outline btn-primary cbtn" onclick="fanka(2)">与原单对比</a>
         {/if}
      
        
      <!--详情-->
         <table class="table row-margin-top table-bordered bud_hei table-hover hide_table">
            <tr class="info">
                <th>明细编号</th>
              
               <th>经销商</th>
               <th>产品品牌</th>
              
                <th>财年</th>
                <th>一级考核期</th>
               <th>二级考核期</th>
                <th>目标金额(元)</th>
               
            </tr>
     		{volist name="detail" id="vod"}
     			<tr>
					<td>{$apply.no}_{$vod.detail_no}</td>
					<td>{$vod.jingxiao}</td>
					<td>{$vod.pinpai}</td>
					<td>{$vod.cainian}</td>
					<td>{$vod.yijikaoheqi}</td>
					<td>{$vod.erjikaoheqi}</td>
					<td>{$vod.feiyong}</td>
     			</tr>
     		{/volist}
      </table> 
      <!--详情-->
      <!--产品-->
         <table class="table row-margin-top table-bordered bud_hei hide_table">
          <tr class="info text-center">
            <th>经销商</th>
       		<th>品牌</th>
       		{volist name="ck" id="vock"}
            	<th>{$vock.kaoheqi}({$vock.cainian})</th>
            {/volist}
            <th>合计</th>
          </tr>
 
         
          {volist name="huizong" id="voq"}
          	<tr>
          		{if $voq.hang neq 0}
          		<td rowspan="{$voq.hang}" class=''>{$voq.jingxiao}</td>
          		{/if}
				<td>{$voq.pinpai}</td>
				{volist name="ck" id="voc1"}
					<td>
            		{volist name="huizongde" id="voqd1"}
            			{if condition="($voqd1.jingxiao eq $voq.jid) and ($voqd1.pinpai eq $voq.pid) and ($voqd1.cainian eq $voc1.cid) and ($voqd1.kaoheqi eq $voc1.kid)"}
            			{$voqd1.f}
            			{/if}
            		{/volist}
            		</td>
            	{/volist}
            	<td>{$voq.f}</td>
          	</tr>
          {/volist}
          <tr class="warning">
            <td class="text-left"  colspan="{$kc+1}" headers="">预算总计：</td>
            <td>{$sumhuizong}</td>
          </tr>
          
      </table>
      <!--产品-->
      {if $apply.state2==2}
         <table class="table row-margin-top table-bordered bud_hei table-hover hide_table">
            <tr class="info">
                
              
               <th>经销商</th>
               <th>产品品牌</th>
              
                <th>财年</th>
                <th>一级考核期</th>
               <th>二级考核期</th>
                <th>目标金额(元)</th>
               <th>原目标金额(元)</th>
               <th>对比金额(元)</th>
            </tr>
        {volist name="tongjidata" id="vod"}
          <tr>
         
          <td>{$vod.jingxiao}</td>
          <td>{$vod.pinpai}</td>
          <td>{$vod.cainian}</td>
          <td>{$vod.yijikaoheqi}</td>
          <td>{$vod.erjikaoheqi}</td>
          <td>{$vod.feiyong}</td>
          <td>{$vod.yuanfeiyong}</td>
          <td>{$vod.duibi}</td>
          </tr>
        {/volist}
      </table> 
      {/if}
   
       <table class="table table-bordered text-left bud_hei">
            <tr class="info">
                <th class="text-left font-bold">审批意见</th>
            </tr>
            {volist name="logs" id="l"}
          <tr>
              <td>{$l.USERNAME} 审批动作：{$l.MEMO}；审批意见：{if $l.COMMENTS}{$l.COMMENTS}{else/}无{/if}(审批时间：{$l.ACTIONTIME})</td>
          </tr>
          
          {/volist}
      
      
      </table>
       {if $fujian}
       <table class="table table-bordered text-left bud_hei">
            <tr class="info">
                <th class="text-left font-bold">附件列表</th>
            </tr>
            <tr><td>
          {volist name="fujian" id="f"}
            <a onclick="down({$f.id})">{$f.file_name}</a>&nbsp;&nbsp;
          {/volist}
          </td></tr>
        </table>
      {/if}

    </div>
     {if condition="$apply.tag eq 1"}
       <div class="SuccessImg font-bold">
        申报已异动
      </div>
    {/if}
     {if condition="$apply.tag neq 1 and $apply.state eq 7"}
        <div class="applyImg font-bold">
        申报已生效
      </div>
    {/if}

    </div>
    <a href="#" title="">刷新</a>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <!-- <script src="js/plugins/layer/layer.min.js"></script> -->

    <!-- 自定义js -->
    <!-- <script src="js/hplus.js?v=4.1.0"></script> -->
    <!-- <script type="text/javascript" src="js/contabs.js"></script> -->
     <!-- Peity -->
    <script src="__STATIC__/layout/js/plugins/peity/jquery.peity.min.js"></script>

    <!-- jqGrid -->
    <script src="__STATIC__/layout/js/plugins/jqgrid/i18n/grid.locale-cn.js?0820"></script>
    <script src="__STATIC__/layout/js/plugins/jqgrid/jquery.jqGrid.min.js?0820"></script>

    <!-- 自定义js -->
    <script src="__STATIC__/layout/js/content.js?v=1.0.0"></script>
     <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    
    <!-- ztree -->
    <script type="text/javascript" src="__STATIC__/layout/js/jquery.ztree.core.js"></script>
    <script type="text/javascript" src="__STATIC__/layout/js/jquery.ztree.excheck.js"></script>
    <!-- <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script> -->
    <!--统计代码，可删除-->
    <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
    <script>

        function down(id){
          window.open("{:url('download_fujian')}?fid="+id)
        }
        //默认第一个选项卡选中
        $(".cbtn").eq(0).addClass("active");
        $(".hide_table").eq(0).show();

        function fanka(i){
            $(".cbtn").removeClass("active");
            $(".hide_table").hide();

            $(".cbtn").eq(i).addClass("active");
            $(".hide_table").eq(i).show();
        }
        $(".ned_td").each(function(){
        	var index=$(this).attr("tag");
        	var he=0;
        	$(".ned_tr").each(function(){
        		if(!isNaN(parseFloat($(this).children().eq(index).html())))
        			he+=parseFloat($(this).children().eq(index).html());
        	})
        	$(this).html(he);
        })
         $(".nef_td").each(function(){
        	var index=$(this).attr("tag")*1+1;
        	var he=0;
        	$(".nef_tr").each(function(){
        		if(!isNaN(parseFloat($(this).children().eq(index).html())))
        			he+=parseFloat($(this).children().eq(index).html());
        	})
        	$(this).html(he);
        })
           $(".neq_td").each(function(){
        	var index=$(this).attr("tag");
        	var he=0;
        	$(".neq_tr").each(function(){
        		if(!isNaN(parseFloat($(this).children().eq(index).html())))
        			he+=parseFloat($(this).children().eq(index).html());
        	})
        	$(this).html(he);
        })
            $(".nec_td").each(function(){
        	var index=$(this).attr("tag");
        	var he=0;
        	$(".nec_tr").each(function(){
        		if(!isNaN(parseFloat($(this).children().eq(index).html())))
        			he+=parseFloat($(this).children().eq(index).html());
        	})
        	$(this).html(he);
        })
    </script>
</body>

</html>
